//package com.zhang.authoritycenter.service;
//
//import com.alibaba.fastjson.JSON;
//import org.springframework.security.access.AccessDeniedException;
//import org.springframework.security.web.access.AccessDeniedHandler;
//import org.springframework.stereotype.Service;
//
//import javax.servlet.ServletException;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * description
// *
// * @author zhangFanJun
// * @date 2023-12-04 17:27
// **/
//@Service
//public class MyAccessDeniedHandle implements AccessDeniedHandler{
//
//    @Override
//    public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException e) throws IOException, ServletException {
//        response.setContentType("application/json;charset=utf-8");
//        // 这里写死只做测试  请以实际为主
//        Map<String, Object> map = new HashMap<>();
//        map.put("code", 501);
//        map.put("msg", "您没有权限");
//        response.getWriter().println(JSON.toJSONString(map));
//        response.getWriter().flush();
//    }
//}
